
package com.insigma.business.qrcode.merchant.converter;

import com.insigma.business.qrcode.common.converter.AbstractConverter;
import com.insigma.business.qrcode.merchant.dto.CareWelfareMerchantInfoLogDTO;
import com.insigma.business.qrcode.merchant.dto.request.CareWelfareMerchantInfoLogSearchRequest;
import com.insigma.business.qrcode.merchant.dto.search.CareWelfareMerchantInfoLogBSearcher;
import com.insigma.business.qrcode.merchant.entity.CareWelfareMerchantInfoLog;
import org.springframework.beans.BeanUtils;
import java.util.List;


public class CareWelfareMerchantInfoLogProviderConverter extends AbstractConverter<CareWelfareMerchantInfoLogDTO, CareWelfareMerchantInfoLog> {

    private final static CareWelfareMerchantInfoLogProviderConverter careWelfareMerchantEntryApplyConverter = new CareWelfareMerchantInfoLogProviderConverter();

    private CareWelfareMerchantInfoLogProviderConverter(){}

    
    public static CareWelfareMerchantInfoLogBSearcher convertRequestSO2Searcher(final CareWelfareMerchantInfoLogSearchRequest request){
        final CareWelfareMerchantInfoLogBSearcher careWelfareMerchantEntryApplyBSearcher = new CareWelfareMerchantInfoLogBSearcher(request.getPageNo(),
        request.getPageSize(),request.getSortKeyValueJoint());
        BeanUtils.copyProperties(request,careWelfareMerchantEntryApplyBSearcher);
        return careWelfareMerchantEntryApplyBSearcher;
    }



    public static List<CareWelfareMerchantInfoLogDTO> convertResponseDOList2DTOList(final List<CareWelfareMerchantInfoLog> careWelfareMerchantEntryApplyList){
        return careWelfareMerchantEntryApplyConverter.convertGenericResponseDOList2DTOList(careWelfareMerchantEntryApplyList);
    }

    
    public static CareWelfareMerchantInfoLogDTO convertResponseDO2DTO(final CareWelfareMerchantInfoLog careWelfareMerchantEntryApply){
        return careWelfareMerchantEntryApplyConverter.convertGenericResponseDO2DTO(careWelfareMerchantEntryApply);
    }


    @Override
    protected CareWelfareMerchantInfoLogDTO doConvertResponseDO2DTO(CareWelfareMerchantInfoLog careWelfareMerchantEntryApply) {
        final CareWelfareMerchantInfoLogDTO careWelfareMerchantEntryApplyDTO = new CareWelfareMerchantInfoLogDTO();
        try {
            BeanUtils.copyProperties(careWelfareMerchantEntryApply, careWelfareMerchantEntryApplyDTO);
        }catch(RuntimeException be){
            
            return null;
        }
        return careWelfareMerchantEntryApplyDTO;
    }

}
